﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Linq;
using System.Text;

namespace Marmat.Forms.Skin
{
    partial class Breadcrumb
    {
        /// <summary>
        /// 获取默认大小
        /// </summary>
        protected override Size DefaultSize => new Size(150, 25);

        /// <summary>
        /// 获取或设置背景颜色
        /// </summary>
        [DefaultValue(typeof(Color), nameof(Color.Transparent))]
        public new Color BackColor
        {
            get => _backColor;
            set
            {
                this._backColor = value;
                this.Invalidate();

            }
        }
        private Color _backColor = Color.Transparent;

        /// <summary>
        /// 获取或设置选中色
        /// </summary>
        [Category("样式"), Description("获取或设置选中色")]
        [DefaultValue(typeof(Color), "66, 158, 251")]
        public Color SelectedColor
        {
            get => this._selectedColor;
            set
            {
                this._selectedColor = value;
                this.Invalidate();
            }
        }
        private Color _selectedColor = Configuration.DefaultTheme.Primary;

        /// <summary>
        /// 获取或设置分割符
        /// </summary>
        [Category("样式"), Description("获取或设置分割符")]
        [DefaultValue('/')]
        [Localizable(true)]
        public char IntervalChar
        {
            get => this._intervalChar;
            set
            {
                this._intervalChar = value;
                this.Invalidate();
            }
        }
        private char _intervalChar = '/';


        /// <summary>
        /// 获取 GroupButton 中的项
        /// </summary>
        [Category("数据"), Description("Breadcrumb 中的项")]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public BreadcrumbItemCollection Items { get; }

        /// <summary>
        /// 在单击 BreadcrumbItem 后发生
        /// </summary>
        [Category("操作"), Description("在单击 BreadcrumbItem 后发生")]
        public event EventHandler<BreadcrumbArgs> ItemClicked;


        //储存矩形
        private Dictionary<BreadcrumbItem, Rectangle> rectangleDec = new Dictionary<BreadcrumbItem, Rectangle>();
        //鼠标位置
        private Point point = new Point(-1, -1);
        //点击的按钮
        private BreadcrumbItem clickItem;
    }
}
